package win_service

import (
	"log/slog"
	"time"

	"github.com/kardianos/service"
)

type program struct{}

func (p *program) Start(s service.Service) error {
	slog.Info("服务Start()")
	go p.run()
	return nil
}

func (p *program) run() {
	slog.Info("服务run()")
	go func() {
		for {
			time.Sleep(5 * time.Minute)
			slog.Info("running")
		}
	}()
}

func (p *program) Stop(s service.Service) error {
	slog.Info("服务Stop()")
	return nil
}
